﻿<!DOCTYPE html>
<html>
<!-- 个人安全行动计划审批 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" class="popupW100" v-cloak>
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                 size="mini">
            <!--<el-row>
        <el-col :span="11">
            <div class="elst-select-mini">
                <el-form-item prop="year">
                    <el-input type="text" v-model="Form.year" autocomplete="off" size="mini" disabled>
                        <template slot="prepend">
                            {{PersonSafePlanManagement.year+mark.m}}
                        </template>
                    </el-input>

                </el-form-item>
            </div>
        </el-col>
        <el-col :span="11">
            <div class="elst-select-mini">
                <el-form-item prop="quarter">
                    <el-input type="text" v-model="Form.quarter" autocomplete="off" size="mini" disabled>
                        <template slot="prepend">
                            {{PersonSafePlanManagement.quarter+mark.m}}
                        </template>
                    </el-input>

                </el-form-item>
            </div>
        </el-col>

    </el-row>-->
            <el-row>
                <el-col :span="11">
                    <p class="main-label">{{PersonSafePlanManagement.year+mark.m}}</p>
                    <p class="lh35">{{Form.year}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{PersonSafePlanManagement.quarter+mark.m}}</p>
                    <p v-if="Form.quarter==1" class="lh35">第一季度</p>
                    <p v-if="Form.quarter==2" class="lh35">第二季度</p>
                    <p v-if="Form.quarter==3" class="lh35">第三季度</p>
                    <p v-if="Form.quarter==4" class="lh35">第四季度</p>
                </el-col>

            </el-row>
            <!--<el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="actualContent">
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{PersonSafePlanManagement.actualContent+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea" v-model="Form.actualContent"
                                          autocomplete="off" disabled></el-input>

                            </div>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="remarks">
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{PersonSafePlanManagement.remarks+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea" v-model="Form.remarks"
                                          autocomplete="off" disabled></el-input>

                            </div>
                        </el-form-item>
                    </div>
                </el-col>

            </el-row>-->
            <!--<el-row>
                <el-col :span="20">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input disabled type="text" v-model="Form.attachmentName" autocomplete="off" size="mini"
                                      readonly>
                                <template slot="prepend">
                                    {{PersonSafePlanManagement.attachment+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

            </el-row>-->
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-table ref="table" :data="ListItem.jG_PersonalSafetyDetail" :row-key="getRowKeys" border
                                  @current-change="tableHandleCurrentChange" class="tb-edit" row-style="height:10px" style="width: 100%;">
                            <el-table-column prop="Project" :label="col.SequenceNumber" width="50">
                                <template slot-scope="props">
                                    {{props.$index + 1}}
                                </template>
                            </el-table-column>
                            <!--<el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
     show-overflow-tooltip="true"></el-table-column>-->

                            <el-table-column prop="planContent" :label="PersonSafePlanManagement.planMain">

                            </el-table-column>

                        </el-table>


                    </div>
                </el-col>
            </el-row>
            <!--<el-row>
        <el-col :span="24">
            <div class="elst-select-mini">
                <el-form-item prop="state">
                    <div class="el-input--mini el-input-group">
                        <div class="el-input-group__prepend">
                            {{PersonSafePlanManagement.examination+mark.m}}
                        </div>
                        <el-radio-group v-model="Form.state">
                            <el-radio label="2" key="2">同意</el-radio>
                            <el-radio label="3" key="3">不同意</el-radio>
                        </el-radio-group>

                    </div>
                </el-form-item>
            </div>
        </el-col>

    </el-row>-->
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm','2')">同意</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm','3')">不同意</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                value1: '',
                // picked : '1',
                //父业传参
                id: '',
                ////获取下拉菜单frequency
                //frequency: [],
                //业务表单内容
                ListItem: ListItem,
                Form: {
                    id: guidEmpty,
                    year: '',
                    quarter: '',
                    ActualContent: '',
                    Remarks: '',
                    attachmentId: '',
                    attachmentName: '',
                    state: '',
                    jG_PersonalSafetyDetail: []
                },
                //表单验证
                rules: {
                    year: [
                        verification.NotNull,
                    ],
                    quarter: [
                        verification.NotNull,
                    ]
                    ,state: [
                        verification.NotNull,
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                ////提交数据
                //onSubmitForm: function (formName) {
                //    var mythis = this;
                //    this.$refs[formName].validate(function (valid) {
                //        //验证通过
                //        if (valid) {
                //            onSubmitForm(this, '/api/JG_PersonalSafety/Save', mythis.Form);
                //        } else {
                //            //验证失败
                //            return false;
                //        }
                //    });
                //},
                //提交数据
                onSubmitForm: function (formName,state) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            mythis.Form.state = state;
                            onSubmitForm(this, '/api/JG_PersonalSafety/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/JG_PersonalSafety/get?id=' + this.id);
                    this.Form.frequency = this.Form.frequency + "";
                },
                handblur: function () {
                    //this.$refs.table.setCurrentRow(999);
                    //console.log("c", 'c');
                },
                //table选中行handle
                tableHandleCurrentChange: function (currentRow) {
                    this.currSeelctId = currentRow.id;
                    this.currSeelctCell = currentRow;
                },
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
                //读取数据到表格数据对象
                this.ListItem.jG_PersonalSafetyDetail = this.Form.jG_PersonalSafetyDetail;
                ////获取下拉菜单内容
                //this.frequency = getDicData('56');
                //初始化数据
                // this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
            },
        });
    </script>
</body>

</html>